/*
 * <one line to give the program's name and a brief idea of what it does.>
 * Copyright (C) 2019
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "shipai.hpp"
#include "datatable.hpp"

ShipAI::ShipAI(const uint16_t level) {
	m_Level = level;
	reset();
}

double ShipAI::getDamage() const {
	return m_Weapon;
}

double ShipAI::getHP() const {
	return m_HP;
}

double ShipAI::getShield() const {
	return m_Shield;
}

double ShipAI::getShieldAbsorption() const {
	return 1 + 0.02 * (m_Level - 1);
}

uint32_t ShipAI::getSpeed() const {
	return m_Speed * 100;
}

void ShipAI::reset() {
	m_Weapon = DataTable::aiStats[m_Level][0];
	m_Shield = DataTable::aiStats[m_Level][1];
	m_HP = DataTable::aiStats[m_Level][2];
	m_Speed = DataTable::aiStats[m_Level][3];
	m_Data = ShipData();
}

resource ShipAI::reward(const uint16_t level) {
	return DataTable::aiReward[level];
}

resource ShipAI::rewardTotal(const uint16_t level) {
	return DataTable::aiRewardTotal[level];
}




